<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<List<LengthOfStayMonthSummary>>" %>
<%@ Import Namespace="RMH.DataAccess.AdoNet.ReportEntities"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	LengthOfStay
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CssContent" runat="server">
	<link href="/Content/LengthOfStay.css" rel="Stylesheet" type="text/css" />
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Report - Length of Stay</h2>   
       
    <form action="/Report/LengthOfStay" method="get">
    
    <p>
        <label>From:</label>
        <%= Html.TextBox("startDate", "", new { style="width:100px;" })%>
        &nbsp;&nbsp;
        <label>To:</label>
        <%= Html.TextBox("endDate", "", new { style = "width:100px;" })%>
        &nbsp;&nbsp;
        <input type="submit" value="Run Report" />                
    </p>         
    <table>
        <thead>
            <tr>
                <th>Month</th>
                <th>Year</th>
                <th>Average Stay (hrs)</th>
                <th>Shortest Stay (hrs)</th>
                <th>Longest Stay (hrs)</th>
            </tr>
        </thead>
        <tbody> 
            <% foreach(var monthSummary in Model) { %>
            <tr>
                <td><%= monthSummary.CheckinMonthName %></td>
                <td><%= monthSummary.CheckinYear %></td>
                <td><%= monthSummary.AverageStayHours.HasValue ? monthSummary.AverageStayHours.Value.ToString() : "N/A" %></td>
                <td><%= monthSummary.ShortestStayHours.HasValue ? monthSummary.ShortestStayHours.Value.ToString() : "N/A" %></td>
                <td><%= monthSummary.LongestStayHours.HasValue ? monthSummary.LongestStayHours.Value.ToString() : "N/A" %></td>
            </tr>
            <% } %>
        </tbody>
    </table>
                
    </form>
    
<script type="text/javascript">
    jQuery(function($) {
        $("#startDate, #endDate").datepicker({ showOn: 'both' });
    });
</script>
    
</asp:Content>
